#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements.  See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership.  The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License.  You may obtain a copy of the License at
#
#   http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied.  See the License for the
# specific language governing permissions and limitations
# under the License.
#
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc

from . import notification_service_pb2 as notification__service__pb2


class NotificationServiceStub(object):
  """AirFlowService provides notification function rest endpoint of NotificationService for Notification Service component.
  Functions of NotificationService include:
  1.Send event.
  2.List events.
  """

  def __init__(self, channel):
    """Constructor.

    Args:
      channel: A grpc.Channel.
    """
    self.sendEvent = channel.unary_unary(
        '/notification_service.NotificationService/sendEvent',
        request_serializer=notification__service__pb2.SendEventRequest.SerializeToString,
        response_deserializer=notification__service__pb2.SendEventsResponse.FromString,
        )
    self.listEvents = channel.unary_unary(
        '/notification_service.NotificationService/listEvents',
        request_serializer=notification__service__pb2.ListEventsRequest.SerializeToString,
        response_deserializer=notification__service__pb2.ListEventsResponse.FromString,
        )
    self.listAllEvents = channel.unary_unary(
        '/notification_service.NotificationService/listAllEvents',
        request_serializer=notification__service__pb2.ListAllEventsRequest.SerializeToString,
        response_deserializer=notification__service__pb2.ListEventsResponse.FromString,
        )
    self.listEventsFromId = channel.unary_unary(
        '/notification_service.NotificationService/listEventsFromId',
        request_serializer=notification__service__pb2.ListEventsFromIdRequest.SerializeToString,
        response_deserializer=notification__service__pb2.ListEventsResponse.FromString,
        )
    self.getLatestVersionByKey = channel.unary_unary(
        '/notification_service.NotificationService/getLatestVersionByKey',
        request_serializer=notification__service__pb2.GetLatestVersionByKeyRequest.SerializeToString,
        response_deserializer=notification__service__pb2.GetLatestVersionResponse.FromString,
        )


class NotificationServiceServicer(object):
  """AirFlowService provides notification function rest endpoint of NotificationService for Notification Service component.
  Functions of NotificationService include:
  1.Send event.
  2.List events.
  """

  def sendEvent(self, request, context):
    """Send event.
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def listEvents(self, request, context):
    """List events.
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def listAllEvents(self, request, context):
    """List all events from the start time.
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def listEventsFromId(self, request, context):
    """List all events from the id.
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def getLatestVersionByKey(self, request, context):
    """Get latest version by key
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')


def add_NotificationServiceServicer_to_server(servicer, server):
  rpc_method_handlers = {
      'sendEvent': grpc.unary_unary_rpc_method_handler(
          servicer.sendEvent,
          request_deserializer=notification__service__pb2.SendEventRequest.FromString,
          response_serializer=notification__service__pb2.SendEventsResponse.SerializeToString,
      ),
      'listEvents': grpc.unary_unary_rpc_method_handler(
          servicer.listEvents,
          request_deserializer=notification__service__pb2.ListEventsRequest.FromString,
          response_serializer=notification__service__pb2.ListEventsResponse.SerializeToString,
      ),
      'listAllEvents': grpc.unary_unary_rpc_method_handler(
          servicer.listAllEvents,
          request_deserializer=notification__service__pb2.ListAllEventsRequest.FromString,
          response_serializer=notification__service__pb2.ListEventsResponse.SerializeToString,
      ),
      'listEventsFromId': grpc.unary_unary_rpc_method_handler(
          servicer.listEventsFromId,
          request_deserializer=notification__service__pb2.ListEventsFromIdRequest.FromString,
          response_serializer=notification__service__pb2.ListEventsResponse.SerializeToString,
      ),
      'getLatestVersionByKey': grpc.unary_unary_rpc_method_handler(
          servicer.getLatestVersionByKey,
          request_deserializer=notification__service__pb2.GetLatestVersionByKeyRequest.FromString,
          response_serializer=notification__service__pb2.GetLatestVersionResponse.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'notification_service.NotificationService', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,))
